package io.renren.service.impl;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.ProjectConstant;
import io.renren.common.utils.Query;
import io.renren.dao.MachineDao;
import io.renren.entity.MachineEntity;
import io.renren.service.MachineService;

import java.util.Map;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

@Service("machineService")
public class MachineServiceImpl extends ServiceImpl<MachineDao, MachineEntity> implements MachineService {

	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		Page<MachineEntity> page = this.selectPage(new Query<MachineEntity>(params).getPage(),
				new EntityWrapper<MachineEntity>().eq("status", ProjectConstant.MACHINE_STATUS_ENABLE).orderBy("create_time"));
		return new PageUtils(page);
	}
}
